#include "const.h"

int buildprojectgoal(var_t v, size_t i__, void *p) {
	char buf[256];

	if (v||p||i__) {/*unused*/}

	if (isverbose()) {
		fprintf(stdout, "performing goal \"%s\"\n", v_getvar("goal"));
		fflush(stdout);
	}

	v_nformat(buf, sizeof(buf), "$(toolchaindir)toolchain-build-$(goal).conf");
	fprintf(stderr, "DEBUG: %s\n", buf);
	fflush(stderr);

	if (isfile(buf)) {
		readconf(buf);
		return 1;
	}

	fprintf(stderr, "warning: %s\n",
		v_format("toolchain \"$(target)\" does not support goal \"$(goal)\""));
	fflush(stderr);

	return 0;
}
